package Application.Mirrors;


import Application.AppJoint;
import Application.Layer.Layer;
import Application.Layer.LayerDelegate;

public class BackColorMirror extends Mirror {
    private static BackColorMirror ins = new BackColorMirror();
    public static BackColorMirror getInstance(){
        return ins;
    }

    public void backColorMirrorActivited(Layer layer){
        int height = AppJoint.getInstance().getCanvasHeight();
        int width = AppJoint.getInstance().getCanvasWidth();

        int argb = AppJoint.getInstance().getBackColorArgb();

        for(int i=0;i<width;i++){
            for(int j=0;j<height;j++){
                layer.setArgb(i,j,argb);
            }
        }

        LayerDelegate.getInstance().refreshAll();
        AppJoint.getInstance().flush();
    }
}
